<#import '/ftlLibrary/properteisVariable.ftl' as pv/>
<link href="assets/css/bootstrap-select.css" rel="stylesheet"/>
<link href="assets/css/front/listCommonStyle.css" rel="stylesheet"/>
<link href="assets/css/modify.css" rel="stylesheet"/>
<script src="assets/js/select2/select2.js"></script>
<style>
    .bootbox-close-button {
        width: 19px;
        height: 19px;
        border: none;
        cursor: pointer;
        -webkit-appearance: none;
        float: right;
        top: 4px;
        left: -5px;
        position: relative;
        background: #E9F5FF url("assets/img/nav-img/icon_close.png") no-repeat 0 0;
    }
    .bootbox .modal-dialog {
        width: 60% !important;
    }

    .bootbox .modal-dialog {
        width: 70% !important;
    }

    .modal-content {
        width: 100%;
    }
</style>
<div class="row myDialogDetai6 myDialogDetai" style="margin-left:0px!important;">
        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
            <div class="row" style="margin-bottom: 15px;margin-top:15px;font-size: 14px">
            <span style="padding-left: 16px">
                收款信息
            </span>
            </div>
            <div class="widget flat radius-bordered" style="margin-top: 0;box-shadow:0px 0px 10px rgba(122,161,184,0.3);">
                <div class="widget-body no-padding">
                    <div class="topPagingBar hidden">
                        <form>
                            <input type="hidden" name="checkboxId" id="checkboxId" value="0">
                        </form>
                    </div>
                    <div class="table-scrollable" style="border: none;">
                        <!-- 数据表列信息列表 -->
                        <table class="table table-hover dataTable newtable">
                            <thead>
                            <tr>
                                <th title="属性名">序号</th>
                                <th title="费用类型">费用类型</th>
                                <th title="合同编号">合同编号</th>
                                <th title="费用明细">费用明细</th>
                                <th title="报名状态">报名状态</th>
                                <th title="缴费金额（元）">缴费金额（元）</th>
                                <th title="优惠金额（元）">优惠金额（元）</th>
                                <th title="操作人">操作人</th>
                                <th title="操作时间">操作时间</th>
                                <th title="备注">备注</th>
                            </tr>
                            </thead>
                            <tbody>
                            <#if packageDetailsList?size==0>
                                <#if DepositDetailsList?size==0>
                                    <#if otherPaymentDetailsList?size==0>
                                        <tr>
                                            <td align="center">无数据</td>
                                        </tr>
                                    </#if>
                                </#if>
                            </#if>
                            <#list packageDetailsList as data>
                                <#if data.paymentType==3>
                                    <tr class="${data.packageId}">
                                        <td>${(data.index???string(data.index?html,""))!''}</td>
                                        <td>
                                            <a href="javascript:void(0);" class="showtr" onclick="details(this)" packageId=${data.packageId}>+</a>
                                            ${(data.paymentType???string(data.paymentType?html,""))!''}
                                        </td>
                                        <td>${(data.contractNumber???string(data.contractNumber?html,""))!''}</td>
                                        <td>${(data.packageName???string(data.packageName?html,""))!''}</td>
                                        <td>${(data.applyStatus???string(data.applyStatus?html,""))!''}</td>
                                        <td>${(data.sumPrice???string(data.sumPrice?html,""))!''}</td>
                                        <td>${(data.discountedPrice???string(data.discountedPrice?html,""))!''}</td>
                                        <td>${(data.paymentCode???string(data.paymentCode?html,""))!''}</td>
                                        <td>${(data.updateTime???string(data.updateTime?html,""))!''}</td>
                                        <td>${(data.userName???string(data.userName?html,""))!''}</td>
                                        <td>${(data.remark???string(data.remark?html,""))!''}</td>
                                    </tr>
                                </#if>
                                <#if data.paymentType!=3>
                                    <tr>
                                        <td>${(data.index???string(data.index?html,""))!''}</td>
                                        <td>
                                            ${(data.paymentType???string(data.paymentType?html,""))!''}
                                        </td>
                                        <td>${(data.contractNumber???string(data.contractNumber?html,""))!''}</td>
                                        <td>${(data.packageName???string(data.packageName?html,""))!''}</td>
                                        <td>${(data.applyStatus???string(data.applyStatus?html,""))!''}</td>
                                        <td>${(data.sumPrice???string(data.sumPrice?html,""))!''}</td>
                                        <td>${(data.discountedPrice???string(data.discountedPrice?html,""))!''}</td>
                                        <td>${(data.paymentCode???string(data.paymentCode?html,""))!''}</td>
                                        <td>${(data.updateTime???string(data.updateTime?html,""))!''}</td>
                                        <td>${(data.userName???string(data.userName?html,""))!''}</td>
                                        <td>${(data.remark???string(data.remark?html,""))!''}</td>
                                    </tr>
                                </#if>
                            </#list>
                            <#list DepositDetailsList as data>
                                <tr>
                                    <td>${(data.index???string(data.index?html,""))!''}</td>
                                    <td>${(data.paymentType???string(data.paymentType?html,""))!''}</td>
                                    <td>${(data.contractNumber???string(data.contractNumber?html,""))!''}</td>
                                    <td>${(data.paymentType???string(data.paymentType?html,""))!''}</td>
                                    <td>${(data.applyStatus???string(data.applyStatus?html,""))!''}</td>
                                    <td>${(data.amount???string(data.amount?html,""))!''}</td>
                                    <td>${(data.discountedPrice???string(data.discountedPrice?html,""))!''}</td>
                                    <td>${(data.paymentCode???string(data.paymentCode?html,""))!''}</td>
                                    <td>${(data.updateTime???string(data.updateTime?html,""))!''}</td>
                                    <td>${(data.userName???string(data.userName?html,""))!''}</td>
                                    <td>${(data.remark???string(data.remark?html,""))!''}</td>
                                </tr>
                            </#list>
                            <#list otherPaymentDetailsList as data>
                                <tr>
                                    <td>${(data.index???string(data.index?html,""))!''}</td>
                                    <td>${(data.paymentType???string(data.paymentType?html,""))!''}</td>
                                    <td>${(data.contractNumber???string(data.contractNumber?html,""))!''}</td>
                                    <td>${(data.paymentType???string(data.paymentType?html,""))!''}</td>
                                    <td>${(data.applyStatus???string(data.applyStatus?html,""))!''}</td>
                                    <td>${(data.amount???string(data.amount?html,""))!''}</td>
                                    <td>${(data.discountedPrice???string(data.discountedPrice?html,""))!''}</td>
                                    <td>${(data.paymentCode???string(data.paymentCode?html,""))!''}</td>
                                    <td>${(data.updateTime???string(data.updateTime?html,""))!''}</td>
                                    <td>${(data.userName???string(data.userName?html,""))!''}</td>
                                    <td>${(data.remark???string(data.remark?html,""))!''}</td>

                                </tr>
                            </#list>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>


        </div>
</div>
<script>
    $(".selectpicker").select2();

    var zxc = false;

    $(function () {
        $(".showtr").trigger("click");
    })

    function details(that) {
        if(zxc == false){
            var packageId = $(that).attr("packageId");
            ajaxRequest("tssPaymentController/packagePaymentDetails.do", {
                packageId: packageId
            }, function (result) {
                var data=result.data;
                var arr="";
                for (var i = 0; i< data.length; i++) {
                    arr+=('<tr class="addtr">' +
                        '<td></td>' +
                        '<td>'+data[i].paymentType+'</td>' +
                        '<td>'+data[i].contractNumber+'</td>' +
                        '<td>'+data[i].paymentType+'</td>' +
                        '<td>'+data[i].applyStatus+'</td>' +
                        '<td>'+data[i].amount+'</td>' +
                        '<td>'+data[i].discountedPrice+'</td>' +
                        '<td>'+data[i].paymentCode+'</td>' +
                        '<td>'+data[i].updateTime+'</td>' +
                        '<td>'+data[i].userName+'</td>' +
                        '<td>'+data[i].remark+'</td>' +
                        '</tr>');
                }
                console.log(arr);
                $("."+packageId).after(arr);
                zxc = true;
                $(".showtr").html("-")

            }, function () {
                ajaxError("加载页面失败!")
            }, "get", "json")
        } else {
            $(".addtr").remove();
            zxc = false;
            $(".showtr").html("+")
        }
    }

</script>